From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0193.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0187.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0187.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0181.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0180.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0194.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0188.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0188.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0182.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0181.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0195.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0189.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0189.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0183.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0182.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0196.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0190.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0190.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0184.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0183.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0197.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0191.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0191.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0185.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0184.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0198.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0192.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0192.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0186.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0185.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0199.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0193.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0193.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0187.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0186.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0200.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0194.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0194.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0188.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0187.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0201.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0195.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0195.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0189.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0188.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0202.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0196.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0196.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0190.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0189.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0001.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0001.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0001.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0001.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0001.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0002.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0002.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0002.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0002.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0002.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0003.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0003.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0003.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0003.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0003.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0004.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0004.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0004.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0004.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0004.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0005.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0005.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0005.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0005.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0005.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0006.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0006.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0006.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0006.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0006.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0007.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0007.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0007.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0007.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0007.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0008.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0008.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0008.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0008.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0008.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0009.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0009.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0009.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0009.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0009.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0010.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0010.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0010.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0010.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0010.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0001.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0001.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0001.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0001.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0001.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0002.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0002.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0002.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0002.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0002.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0003.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0003.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0003.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0003.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0003.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0004.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0004.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0004.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0004.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0004.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0005.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0005.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0005.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0005.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0005.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0006.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0006.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0006.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0006.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0006.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0007.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0007.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0007.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0007.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0007.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0008.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0008.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0008.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0008.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0008.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0009.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0009.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0009.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0009.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0009.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0010.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0010.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0010.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0010.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0010.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0001.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0001.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0001.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0001.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0001.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0002.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0002.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0002.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0002.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0002.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0003.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0003.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0003.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0003.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0003.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0004.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0004.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0004.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0004.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0004.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0005.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0005.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0005.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0005.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0005.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0006.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0006.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0006.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0006.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0006.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0007.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0007.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0007.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0007.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0007.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0008.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0008.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0008.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0008.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0008.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0009.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0009.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0009.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0009.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0009.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0010.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0010.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0010.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0010.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0010.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0011.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0011.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0011.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0011.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0011.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0012.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0012.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0012.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0012.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0012.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0013.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0013.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0013.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0013.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0013.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0014.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0014.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0014.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0014.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0014.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0015.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0015.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0015.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0015.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0015.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0016.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0016.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0016.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0016.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0016.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0017.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0017.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0017.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0017.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0017.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0018.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0018.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0018.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0018.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0018.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0019.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0019.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0019.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0019.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0019.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0020.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0020.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0020.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0020.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0020.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0021.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0021.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0021.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0021.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0021.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0022.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0022.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0022.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0022.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0022.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0023.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0023.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0023.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0023.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0023.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0024.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0024.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0024.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0024.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0024.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0025.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0025.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0025.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0025.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0025.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0026.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0026.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0026.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0026.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0026.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0027.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0027.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0027.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0027.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0027.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0028.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0028.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0028.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0028.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0028.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0029.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0029.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0029.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0029.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0029.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0030.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0030.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0030.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0030.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0030.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0031.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0031.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0031.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0031.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0031.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0032.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0032.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0032.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0032.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0032.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0033.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0033.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0033.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0033.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0033.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0034.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0034.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0034.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0034.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0034.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0035.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0035.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0035.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0035.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0035.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0036.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0036.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0036.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0036.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0036.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0037.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0037.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0037.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0037.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0037.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0038.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0038.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0038.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0038.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0038.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0039.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0039.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0039.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0039.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0039.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0040.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0040.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0040.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0040.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0040.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0041.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0041.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0041.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0041.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0041.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0042.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0042.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0042.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0042.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0042.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0043.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0043.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0043.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0043.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0043.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0044.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0044.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0044.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0044.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0044.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0045.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0045.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0045.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0045.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0045.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0046.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0046.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0046.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0046.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0046.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0047.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0047.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0047.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0047.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0047.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0048.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0048.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0048.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0048.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0048.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0049.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0049.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0049.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0049.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0049.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0050.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0050.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0050.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0050.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0050.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0051.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0051.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0051.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0051.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0051.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0052.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0052.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0052.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0052.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0052.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0053.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0053.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0053.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0053.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0053.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0054.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0054.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0054.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0054.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0054.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0055.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0055.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0055.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0055.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0055.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0056.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0056.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0056.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0056.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0056.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0057.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0057.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0057.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0057.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0057.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0058.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0058.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0058.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0058.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0058.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0059.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0059.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0059.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0059.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0059.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0060.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0060.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0060.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0060.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0060.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0061.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0061.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0061.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0061.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0061.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0062.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0062.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0062.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0062.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0062.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0063.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0063.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0063.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0063.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0063.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTester.java:33) at examples.UPBTester$4.run(UPBTester.java:311) at java.awt.event.InvocationEvent.dispatch(libgcj.so.7) at java.awt.EventQueue.dispatchEvent(libgcj.so.7) at java.awt.EventDispatchThread.run(libgcj.so.7) I'm not a coder on Linux yet, so any ideas on where to start going after this error would be much appreciated. Thanks, Rich From tjarvi at qbang.org Fri Nov 17 13:00:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Nov 2006 13:00:05 -0700 (MST) Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: <455E0080.3010202@eecosystems.com> References: <455E0080.3010202@eecosystems.com> Message-ID: On Fri, 17 Nov 2006, Richard Clem wrote: > I am trying to get an application that is working on MacOSX in Eclipse > working on Ubuntu in Eclipse. > > I downloaded and installed the jre from Blackdown and the current RXTX > releated files and my project builds without errors, but when I run my > test I receive the following error: > > at java.awt.EventDispatchThread.run(libgcj.so.7) Hi Rich Yikes. libgcj is the GNU "Java as a subset of C++" implementation. It is neat and powerfull but it is not Blackdown Java. You need to back up and figure out your path. I do not know if we work with gcj out of the box. It is close. Blackdown was actually the first target rxtx ever worked on and should work now. bash: export PATH=/opt/blackdown/bin:$PATH bin having the java executable in it. Who knows where the library is if you typed make install using gcj :) In short, I don't think you realized Linux distributions have their own open source Java tools at this time. You need to put other tools in the front of your path. -- Trent Jarvi tjarvi at qbang.org From richardc at eecosystems.com Fri Nov 17 15:20:08 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 14:20:08 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE In-Reply-To: References: <455E0080.3010202@eecosystems.com> Message-ID: <455E3598.4080209@eecosystems.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061117/3670ee43/attachment-0064.html From hankh at ironfamily.com Tue Nov 21 07:35:04 2006 From: hankh at ironfamily.com (Hank Harris) Date: Tue, 21 Nov 2006 09:35:04 -0500 Subject: [Rxtx] OS X NullPointerException Message-ID: <2118E80D-B958-4EC9-9EEB-B2D1EABB4C44@ironfamily.com> I am a first time installer of RXTX and have run into a road block. I am getting the following error when trying to execute any program trying to open the serial port. durango:/Users/Shared/rxtx-2.1-7r2/contrib root# java Test /dev/tty.GPS opening the Port: /dev/tty.GPS Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 open Ports Exception in thread "main" java.lang.NullPointerException at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:800) at Test.(Test.java:29) at Test.main(Test.java:23) My machine is Intel based running 10.4.8 with "Java build 1.5.0_06-112". I compiled the libraries from the source and manually installed the files into /Library/Java/Extensions and then created the /var/spool/uucp directory with the appropriate permissions. I have even tried to run the test as root to make sure I didn't have a permission error. Does anybody have any ideas what I am doing wrong? Thanks, Hank Harris From carlinw at gmail.com Thu Nov 23 00:07:44 2006 From: carlinw at gmail.com (Carlin Wiegner) Date: Wed, 22 Nov 2006 23:07:44 -0800 Subject: [Rxtx] Newbie question.... Message-ID: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw From tjarvi at qbang.org Thu Nov 23 08:32:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 08:32:28 -0700 (MST) Subject: [Rxtx] Newbie question.... In-Reply-To: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> References: <8d4cb4b0611222307l406c499dhbe0d78740cec789f@mail.gmail.com> Message-ID: On Wed, 22 Nov 2006, Carlin Wiegner wrote: > I am trying to build a pretty basic application that connects over one > of my serial ports. I am having a hard time finding enough > documentation or examples to help me figure out how to use the API. > I'm sure I just haven't been looking in the right place. > > Any guidance would be appreciated. > Hi cw We have the wiki page for sharing programming ideas linked off rxtx.org, others can link their pages from there also. The javadoc will give you the basics. I think Sun's version is more complete than the rxtx version. Examples are always a good starting point. In the rxtx src, there is a contrib directory that we put any code examples, there are open source examples on places like freshmeat.net and I think Sun still has their example code in the downloadable API they provide. Though you will probably need to look in the 3.0 download. You can always ask questions here too. Thats what the list is for -- Trent Jarvi tjarvi at qbang.org From adosanjh at gmail.com Sun Nov 5 21:41:55 2006 From: adosanjh at gmail.com (Avipan Dosanjh) Date: Mon, 06 Nov 2006 04:41:55 -0000 Subject: [Rxtx] Interface to Solaris 10 x86 Message-ID: Hi, I was wondering if anyone has been successful in installing the RXTX library on a Solaris 10 x86 box. The application communicates to an Ibutton from Dallas Semiconductor (DS 1920) and it was created on a windows box and installing the drivers was fairly easy, however when the application was moved to a Solaris x86 box communicating to the port has become a problem. I know that there is drivers for Linux and Solaris/Sparc, but I am unable to find information on getting the application working on a Solaris/x86. Can anyone point me in the right direction in this situation. Thanks, Avipan Dosanjh From lenclud.philippe at orange.fr Wed Nov 8 13:06:19 2006 From: lenclud.philippe at orange.fr (Philippe) Date: Wed, 08 Nov 2006 20:06:19 -0000 Subject: [Rxtx] Rxtx library for PPC Linux ? Message-ID: <1163016350.7315.10.camel@macxfree-ppc> Hello, I'm an Apple // user and i use the ADTPro program ( writed by david Schmidt ) which use the RXTX library. This java program is working fine for me under Mac Osx to transfer old Apple // software. Actualy, on my PowerMac G4 PPC, i'm using the linux distro "UBUNTU edgy" and i'm searching the RXTX library PPC based. Is there a possibility to get it anywhere on the web ? Thank you for your answer. Best regards from France Philip From pgagne at 123certification.com Mon Nov 13 12:12:01 2006 From: pgagne at 123certification.com (=?ISO-8859-1?Q?Pierre-Luc_Gagn=E9?=) Date: Mon, 13 Nov 2006 14:12:01 -0500 Subject: [Rxtx] SerialEvent Message-ID: <4558C381.7020107@123certification.com> Hi, I add a notify on my SerialPort for the data available field (same for others notify), but the method "serialEvent (SerialPortEvent ev)" is not called on Linux (it is actually working well under Windows) class myClass implements SerialPortEventListener { ... SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); s.notifyOnDataAvailable(true); s.addEventistener(this); ... public void serialEvent(SerialPortEvent ev) { switch(ev.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: System.out.println("DATA_AVAILABLE"); break; } } } This code is working under Windows, but not under Linux, does anyone knows why? Thx, PL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061113/8c8880a9/attachment-0064.html From scldad at sdc.com.au Thu Nov 16 00:49:04 2006 From: scldad at sdc.com.au (Stephen Davies) Date: Thu, 16 Nov 2006 18:19:04 +1030 Subject: [Rxtx] Thank you Message-ID: <200611161819.04959.scldad@sdc.com.au> I would like to thank all involved in the development of RXTX. For some reason, I thought that my need for a java interface to serial I/O would be best served by Sun's CommAPI so spent the past month trying to get it to work in my application. The Linux-based application (which is initiated by a cron job) drives a set of modems which dial out to SCADA controllers around South Australia to retrieve soil moisture etc data and to control irrigation equipment. CommAPI worked after a fashion but had a nasty habit of converting LF characters (and maybe CR) in some random fashion so that the data packet CRC algorithm was continually breaking and destroying connections. Today, I decided that enough was enough and downloaded RXTX (2.1-7). It took a matter of minutes to convert the application to the new package/library and all the data hassles immediately disappeared. The only question I have at this point is regarding lock files. If, for example /dev/ttyS5 is locked when a cycle tries to access it, I get stdout messages telling me that the lock file already exists but no exception is taken in my Java code. Could somebody please tell me how to trap this event as the connections are all cron-invoked and nobody is watching to see the stdout messages. Cheers, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From colin.chaballier at orange-ftgroup.com Thu Nov 23 00:56:43 2006 From: colin.chaballier at orange-ftgroup.com (zze-CHABALLIER Colin RD-BIZZ-SOP) Date: Thu, 23 Nov 2006 08:56:43 +0100 Subject: [Rxtx] Newbie question.... Message-ID: Hi, Here are basic read/write examples from the rxtx wiki: http://rxtx.qbang.org/wiki/index.php/Examples And at this page, you can find the javax.comm user guide from Sun: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html with other examples. The read example proposed here is interesting since it's event-driven, rather than simply blocking. Note that in the Sun examples you need to change the javax.comm extension by gnu.io in the imports to make it working with rxtx. Colin -----Message d'origine----- De : rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] De la part de Carlin Wiegner Envoy? : jeudi 23 novembre 2006 08:08 ? : rxtx at qbang.org Objet : [Rxtx] Newbie question.... I am trying to build a pretty basic application that connects over one of my serial ports. I am having a hard time finding enough documentation or examples to help me figure out how to use the API. I'm sure I just haven't been looking in the right place. Any guidance would be appreciated. Thanks, cw _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From jchang at evincii.com Mon Nov 20 13:01:05 2006 From: jchang at evincii.com (Justin Chang) Date: Mon, 20 Nov 2006 12:01:05 -0800 Subject: [Rxtx] finer flow control Message-ID: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> I was trying to use RxTx for reading data from Windows XP COM1 and COM2 ports. It requires that the CTS control on output and RTS for connection handshake. I have tried using: serialPort.setFlowControlMode(serialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setRTS(true); to simulate the effect without any success. The read method on the input stream of the COM port always returns 0 bytes. The below CPP function works fine for the exact same COM ports. It seems that it only uses CTS for output flow control and enables the RTS line when the device is opened and leaves it on. It did not work. I did not see a separate method to just set the CTS for output flow control. Does anybody know how to do it? Below is the cpp function that works. BEGIN_USERFUNCTION(DetectorStatus) String PortName = ArgList.GetElement(0); // "COM1" or "COM2" DCB CommState; HANDLE hComm; DWORD status; hComm = CreateFile( PortName.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (hComm == INVALID_HANDLE_VALUE) env->OutputMessage("Unable to open serial port: " + PortName); GetCommState(hComm, &CommState); CommState.fOutxCtsFlow = true; CommState.fRtsControl = RTS_CONTROL_ENABLE; SetCommState(hComm, &CommState); if(!GetCommModemStatus(hComm, &status)) env->OutputMessage("Serial Port Error"); CloseHandle(hComm); Result = (int)(1 - ((status & MS_CTS_ON) >> 4)); END_USERFUNCTION(DetectorStatus) Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061120/69ced337/attachment-0064.html From tjarvi at qbang.org Thu Nov 23 15:04:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:04:18 -0700 (MST) Subject: [Rxtx] SerialEvent In-Reply-To: <4558C381.7020107@123certification.com> References: <4558C381.7020107@123certification.com> Message-ID: On Mon, 13 Nov 2006, Pierre-Luc Gagn? wrote: > Hi, > > I add a notify on my SerialPort for the data available field (same for others > notify), but the method "serialEvent > (SerialPortEvent > ev)" is > not called on Linux (it is actually working well under Windows) > > class myClass implements SerialPortEventListener { > ... > SerialPort s = (SerialPort) CommPortIdentifier.getPortIdentifier(port); > s.notifyOnDataAvailable(true); > s.addEventistener(this); > ... > > public void serialEvent(SerialPortEvent ev) { > switch(ev.getEventType()) { > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("DATA_AVAILABLE"); > break; > } > } > > } > > > This code is working under Windows, but not under Linux, does anyone knows > why? There must be something unusual about your serial port. This works under Linux too with standard UARTs. For unusual cases, such as other devices (USB, BlueTooth, ...) that try to look like serial devices, the kernel driver usually is the cause of problems like you observe. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:20:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:20:28 -0700 (MST) Subject: [Rxtx] Interface to Solaris 10 x86 In-Reply-To: References: Message-ID: On Sun, 5 Nov 2006, Avipan Dosanjh wrote: > Hi, > > I was wondering if anyone has been successful in installing the RXTX > library on a Solaris 10 x86 box. > > The application communicates to an Ibutton from Dallas Semiconductor > (DS 1920) and it was created on a windows box and installing the > drivers was fairly easy, however when the application was moved to a > Solaris x86 box communicating to the port has become a problem. > > I know that there is drivers for Linux and Solaris/Sparc, but I am > unable to find information on getting the application working on a > Solaris/x86. > > Can anyone point me in the right direction in this situation. Hi Avipan If you place GNU make and gcc in the front of your path, the configure script should build a working library for you. It should be possible to use the Sun tools too though I do not know if it has been tested recently. If you have questions about the install after that, we can help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Nov 23 15:21:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 23 Nov 2006 15:21:41 -0700 (MST) Subject: [Rxtx] problems on mac In-Reply-To: References: Message-ID: On Fri, 20 Oct 2006, Robert J. Carr wrote: > I posted this on the Sun forums: > > http://forum.java.sun.com/thread.jspa?messageID=4431672 > > But basically the problem is this ... can I use the RXTX driver > (version 2.0-7pre2) with the Sun javax.comm packages (generic version > 2.0.3) on my Mac (version OSX.4.8)? > > I've tried every combination of using the 2.0 version, 2.1 version, > RXTXcomm.jar, jcl.jar, comm.jar, -Djava.library.path, etc ... nothing > seems to work. > > Everything seems to result in an: > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > ... > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > > Using 2.0 I don't get any RXTX output, but using 2.1 I get this: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Here's the full stack trace (same for 2.0 and 2.1): > > java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver > gnu.io.RXTXCommDriver > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at BlackBox.main(Unknown Source) > Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink > at com.sun.comm.Unix.isDevLink(Native Method) > at com.sun.comm.PathBundle.add(PathBundle.java:108) > at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) > at BlackBox.main(Unknown Source) > > Can anyone provide any help? Hi Robert, I think we answered this for you? I just went through the spam box for the mail-list and found this. -- Trent Jarvi tjarvi at qbang.org From pete.flugstad at gmail.com Mon Nov 27 08:32:34 2006 From: pete.flugstad at gmail.com (Pete Flugstad) Date: Mon, 27 Nov 2006 09:32:34 -0600 Subject: [Rxtx] finer flow control In-Reply-To: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> References: <012601c70cde$9cf8e9e0$6a58a8c0@evincii.net> Message-ID: <84d4a6d50611270732x47b1ca96m7eecb3ec6696b87c@mail.gmail.com> On 11/20/06, Justin Chang wrote: > GetCommState(hComm, &CommState); > CommState.fOutxCtsFlow = true; > CommState.fRtsControl = RTS_CONTROL_ENABLE; > SetCommState(hComm, &CommState); Go peruse the thread starting here: Basically, RXTX selects RTS_CONTROL_TOGGLE (the new style of RTS flow control) when you turn on flow control from the Java interface. In which case RTS control is out of your hands. I had to modify the RXTX source code to use RTS_CONTROL_ENABLE instead so that I could control it explicitly. Pete From g_petrini at yahoo.it Tue Nov 28 00:41:24 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Mon, 27 Nov 2006 23:41:24 -0800 (PST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter Message-ID: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Hi, I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). All work well on my desktop (that has a true serial port) under windows. >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. With this adapter it happens that bytes (sended adn received) are lost. Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). If it's the adapter there is one that work well with rxtx? Thanks Bye Jack __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From lists at java-system.com Tue Nov 28 12:27:41 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 28 Nov 2006 20:27:41 +0100 Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: <456C8DAD.1080100@java-system.com> Giacomo, To solve your doubt the best test is to try your USBtoSerial adapter with plain messages You can use Hyperterminal under Windows (minicom under Linux), connect your desktop computer and your laptop with a null modem cable and try to write some messages on one terminal and verify the other PC receive all the characters You can try even a file transfer and check for transmission errors If this works good then your transmission layer is OK and you have problems elsewhere Ciao Marco Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. > >From times to times it happens that I have to work with a laptop (a Toshiba) that does not have a serial port. So I have to use a usb to serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > > Thanks > > Bye Jack > > > > From tjarvi at qbang.org Wed Nov 29 07:55:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 29 Nov 2006 07:55:25 -0700 (MST) Subject: [Rxtx] [rxtx]problem with a usb-serial adapter In-Reply-To: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> References: <20061128074124.98036.qmail@web31914.mail.mud.yahoo.com> Message-ID: On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org From g_petrini at yahoo.it Wed Nov 29 09:11:02 2006 From: g_petrini at yahoo.it (Giacomo Petrini) Date: Wed, 29 Nov 2006 08:11:02 -0800 (PST) Subject: [Rxtx] R: [rxtx]problem with a usb-serial adapter Message-ID: <20061129161102.39304.qmail@web31907.mail.mud.yahoo.com> Hi, I'll try thanks. Bye Jack PS: I'll try to do what marco tozzini suggest too. Thanks marco ----- Messaggio originale ----- Da: Trent Jarvi A: RXTX Developers and Users Inviato: Mercoled? 29 novembre 2006, 15:55:25 Oggetto: Re: [Rxtx] [rxtx]problem with a usb-serial adapter On Mon, 27 Nov 2006, Giacomo Petrini wrote: > Hi, > I'm using rxtx in conjunction with jamod (jamod.sourceforge.net). > All work well on my desktop (that has a true serial port) under windows. >> From times to times it happens that I have to work with a laptop (a >> Toshiba) that does not have a serial port. So I have to use a usb to >> serial adapter (always under windows). > The adapter is labeled: Sitecom USB to Serial Adapter CN-104v2. > With this adapter it happens that bytes (sended adn received) are lost. > Does someone had the same behaviour with this adapter? or it's a problem of my program (maybe some timeout). > If it's the adapter there is one that work well with rxtx? > Without recommending specific vendors, the USB kernel drivers tended to be less than complete early on. They are fairly good now. But if you do have problems, make sure you download the latest driver updates from the vendor. If the USB device has been on the market for several years, it is probably OK. If you are losing data, you may try hardware flow control. Examine your code for sections that could be timing specific such as assuming that data is there to read when it may still be in transit. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx __________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it From hellion102 at hotmail.com Wed Nov 29 13:02:17 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 29 Nov 2006 15:02:17 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061129/a14b1308/attachment-0064.html From lyon at docjava.com Thu Nov 30 05:04:03 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Nov 2006 07:04:03 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: Hi Rob, You may want a break-out box for the parallel port in order to debug and develop your program. What did you expect your printer to print when you sent it a code 255? http://www.ascii.cl/ Shows that there is no ASCII code beyond 127. Are you trying to write a printer driver? If not, what are you trying to do with the parallel port? - Doug >Hi to all, and of course Trent. > >I have looked everywhere (including this site) >for code that to communicates with the parallel >port that works! It is tragic that Sunn would go >as far as creating an Comm API and not even >provide examples on how to a use it with the >parallel port. I can see that there is no >true?dedication to?this effort. :( > >Also, I have noticed that when anyone asks >anywhere (this forum?and the?Sunn forums)?about >the possibility of coding to the parallel port, >while even providing their sample code that >they?couldn't get to work, no one responds >clearly on how to fix it or even?do it! > >Trent, I've read?a past posting?in which?you had >mentioned that you created a "Hello World" app >to print the parallel port. Do you still have >it? Can we see it? > >You have also mentioned that other >developers?have performed this small feat. Did >they happen to send in any sample code? Where >can we get it from if not? > >I have tried for hours to send data successfully >to the printer using your api but to no >avail.?It gives me this ridiculous?error in the >console: > > Printer Port LPT1 failed to write : IOException. > Exception: > java.io.IOException: The operation completed successfully. > in writeByte > >Operation completed successfully?????? What the heck does this mean LOL!? >This occurrs when callin the >line?"outputStream.write(255);" in the code >below. > >I do see the light turn?on the printer for a >brief second, but it does not print >anything...... > >Here is the code: > >-------------------------------------------------------------------------------------------------------------------------------------- >import gnu.io.CommPortIdentifier; >import gnu.io.NoSuchPortException; >import gnu.io.ParallelPort; >import gnu.io.PortInUseException; >import gnu.io.SerialPort; >import gnu.io.UnsupportedCommOperationException; >import java.io.IOException; >import java.io.OutputStream; >/** > * > * This class tests the Parallel Port COMM API > * > */ >public class ParallelPortTest >{ > ?? > private static OutputStream outputStream; > private static SerialPort serialPort; > private static ParallelPort parallelPort; > private static Thread readThread; > private static CommPortIdentifier port; > ?? > //CONSTANTS > public static final String PARALLEL_PORT = "LPT1"; > public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ?? > ?? > public static void main(String[] args) > { > ? > System.out.println("Started test...."); > ? > try > { > //get the parallel port connected to the printer > port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > System.out.println("\nport.portType = " + port.getPortType()); > System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > System.out.println("port.name = " + port.getName()); > //open the parallel port > parallelPort = >(ParallelPort)port.open("CommTest", 50); >//open(App name, timeout) > ??????? > >//parallelPort.setMode(ParallelPort.LPT_MODE_SPP); >//this throws errors for some reason > outputStream = parallelPort.getOutputStream(); > System.out.println("Write..."); > outputStream.write(255); > System.out.println("Flush..."); > outputStream.flush(); > System.out.println("Close..."); > outputStream.close(! ); > } > catch (NoSuchPortException nspe) > { > System.out.println("\nPrinter Port LPT1 not found : > >NoSuchPortException.\nException:\n" + nspe + >"\n"); > } > catch (PortInUseException piue) > { > System.out.println("\nPrinter Port LPT1 is in use : > >PortInUseException.\nException:\n" + piue + >"\n"); > } > /* > catch (UnsupportedCommOperationException usce) > { > System.out.println("\nPrinter Port LPT1 fail to write : > >UnsupportedCommException.\nException:\n" + usce >+ "\n"); > } > */ > catch (IOException ioe) > { > System.out.println("\nPrinter Port LPT1 failed to write : > IOException.\nException:\n" + ioe + "\n"); > } > catch (Exception e) > { > System.out.println("\nFailed to open >Printer Port LPT1 with exeception : " + e + >"\n"); > } > finally > { > //if (port.isCurrentlyOwned()) > parallelPort.close(); > ??????? > System.out.println("Closed all resources.\n"); > } > }??? > ?? > ?? >} > >-------------------------------------------------------------------------------------------------------------------------------------- > > > >Any advice or additional resource?would?be of great help. > >Thanks and look forward to your comments! >;) > >Rob. > > > > > > > >Talk >now to your Hotmail contacts with Windows Live >Messenger. > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Nov 30 07:38:19 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 30 Nov 2006 07:38:19 -0700 (MST) Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? In-Reply-To: References: Message-ID: This looks like sane code. What I did was the same without the flush. The printer was a simple epson DX10 (10 char/sec daisy wheel). When I wrote a character, it printed. The Parallel code never was well tested. So you may well have to tinker with it to get what you need. You might try printing out the stack trace to see if its flush or write thats erroring. There are a couple reasons the message may be displaying. First, it could be an error in the Parallel port implementation that is not setting the error number. 0 is success and happens to be the default. Second it could be a logic flaw that was never tested. We have accepted patches (notably for windows) since I first did the DX10 test. I did try it one other time again to make sure it worked. But we just need devel resources to get the Parallel port working at a level some would like. You could always try an older version of rxtx. The Parallel patches that went in should be listed on the front page of rxtx.org if you want to try the older version. > Hi to all, and of course Trent. > ? > I have looked everywhere (including this site) for code that to communicates with the parallel port that works! It is tragic that Sunn > would go as far as creating an Comm API and not even provide examples on how to a use it with the parallel port. I can see that there > is no true?dedication to?this effort. :( > ? > Also, I have noticed that when anyone asks anywhere (this forum?and the?Sunn forums)?about the possibility of coding to the parallel > port, while even providing their sample code that they?couldn't get to work, no one responds clearly on how to fix it or even?do it! > ? > Trent, I've read?a past posting?in which?you had mentioned that you created a "Hello World" app to print the parallel port. Do you > still have it? Can we see it? > ? > You have also mentioned that other developers?have performed this small feat. Did they happen to send in any sample code? Where can we > get it from if not? > ? > I have tried for hours to send data successfully to the printer using your api? but to no avail.?It gives me this ridiculous?error in > the console: > ? > ?????? Printer Port LPT1 failed to write : IOException. > ?????? Exception: > ?? ??? java.io.IOException: The operation completed successfully. > ?????? in writeByte > Operation completed successfully?????? What the heck does this mean LOL!? > This occurrs when callin the line?"outputStream.write(255);" in the code below. > ? > I do see the light turn?on the printer for a brief second, but it does not print anything...... > ? > Here is the code: > ? > -------------------------------------------------------------------------------------------------------------------------------------- > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.ParallelPort; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.UnsupportedCommOperationException; > import java.io.IOException; > import java.io.OutputStream; > /** > ?* > ?* This class tests the Parallel Port COMM API > ?* > ?*/ > public class ParallelPortTest > { > ??? > ??? private static OutputStream outputStream; > ??? private static SerialPort serialPort; > ??? private static ParallelPort parallelPort; > ??? private static Thread readThread; > ??? private static CommPortIdentifier port; > ??? > ??? //CONSTANTS > ??? public static final String PARALLEL_PORT = "LPT1"; > ??? public static final String[] PORT_TYPE = {"Serial Port", "Parallel Port"}; > ??? > ??? > ?public static void main(String[] args) > ?{ > ?? > ???? System.out.println("Started test...."); > ?? > ???? try > ??????? { > ???????? //get the parallel port connected to the printer > ???????? port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); > ???????? System.out.println("\nport.portType = " + port.getPortType()); > ???????? System.out.println("port type = " + PORT_TYPE[port.getPortType()-1]); > ???????? System.out.println("port.name = " + port.getName()); > ???????? //open the parallel port > ???????? parallelPort = (ParallelPort)port.open("CommTest", 50); //open(App name, timeout) > ???????? > ???????? //parallelPort.setMode(ParallelPort.LPT_MODE_SPP); //this throws errors for some reason > ???????? outputStream = parallelPort.getOutputStream(); > ???????? System.out.println("Write..."); > ???????? outputStream.write(255); > ???????? System.out.println("Flush..."); > ???????? outputStream.flush(); > ???????? System.out.println("Close..."); > ???????? outputStream.close(); > ??????? } > ??????? catch (NoSuchPortException nspe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 not found : > ???????????????????????????????????? NoSuchPortException.\nException:\n" + nspe + "\n"); > ??????? } > ???? catch (PortInUseException piue) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 is in use : > ??????????????????????????????????? PortInUseException.\nException:\n" + piue + "\n"); > ??????? } > ???? /* > ???? catch (UnsupportedCommOperationException usce) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 fail to write : > ???????????????????????????????????? UnsupportedCommException.\nException:\n" + usce + "\n"); > ??????? } > ??????? */ > ???? catch (IOException ioe) > ??????? { > ???????? System.out.println("\nPrinter Port LPT1 failed to write : > ??????????????????????????????????? IOException.\nException:\n" + ioe + "\n"); > ??????? } > ??????? catch (Exception e) > ??????? { > ???????? System.out.println("\nFailed to open Printer Port LPT1 with exeception : " + e + "\n"); > ??????? } > ??????? finally > ??????? { > ???????? //if (port.isCurrentlyOwned()) > ???????????? parallelPort.close(); > ???????? > ???????? System.out.println("Closed all resources.\n"); > ??????? } > ?}??? > ??? > ??? > } > ? > -------------------------------------------------------------------------------------------------------------------------------------- > ? > ? > ? > Any advice or additional resource?would?be of great help. > ? > Thanks and look forward to your comments! > ;) > ? > Rob. > ? > ? > ? > ? > ? > > ______________________________________________________________________________________________________________________________________________ > Talk now to your Hotmail contacts with Windows Live Messenger. > From hellion102 at hotmail.com Thu Nov 30 10:58:12 2006 From: hellion102 at hotmail.com (Rob Fisher) Date: Thu, 30 Nov 2006 12:58:12 -0500 Subject: [Rxtx] Does anyone have working sample code for commincating with the Parallel Port? Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20061130/e6ab993a/attachment-0064.html From ajmas at sympatico.ca Thu Nov 30 12:53:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 30 Nov 2006 14:53:54 -0500 Subject: [Rxtx] Single character input Message-ID: Hi, This is not really an RXTX question, but it is one I assume many people on the list have hit at one time or another. I am wanting to improve on: http://rxtx.qbang.org/wiki/index.php/ Two_way_communcation_with_the_serial_port for talking to my serial devices. The serial devices work as a traditional VT100 terminal server, that is I type a character and they echo back the character. The program will be run in my Mac terminal application, so I shouldn't need to add VT100 support myself. The problem I am having is that I am not sure how to receive one character at a time from the user, since I only seem to get the line when a newline is entered. In C++ I can use std::cin.get() for this, but I am not sure how to do this in Java. Has anyone come up with a solution to this? Andre From lists at java-system.com Thu Nov 30 14:13:18 2006 From: lists at java-system.com (marco tozzini) Date: Thu, 30 Nov 2006 22:13:18 +0100 Subject: [Rxtx] RxTx for SableVM, MIPSEL, uClibc Message-ID: <456F496E.9030308@java-system.com> Hi all, In the last days I have tried to create a ipkg package for OpenWRT distribution (www.openwrt.org) I'm using it on my WiFi router MIPSel (MIPS little endian) based No success :( I'm not a programmer :((( :) Trent show me a possible solution (ToyBox) but it seems the wrong libc is used on RxTx compilation I'm no more interested in develop the complete ipkg package, it's enough a working binary code as final result The code should be compiled for MIPSEL arch, uClibc, and SableVM is the VM Can you address me to further solutions Thanks Ciao Marco From barry.pearce at copyrightwitness.net Thu Nov 2 17:07:05 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:07:05 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... Message-ID: <454A8829.9000301@copyrightwitness.net> Hi folks, Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code portId = CommPortIdentifier.getPortIdentifier("COM3"); port = (SerialPort)portId.open("MyApp", 2000); port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); port.close(); portmon shows the following in response to the setFlowControlMode method. 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? Thanks in advance, Barry From barry.pearce at copyrightwitness.net Thu Nov 2 17:48:01 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Fri, 03 Nov 2006 00:48:01 +0000 Subject: [Rxtx] Issue with FLOWCONTROL_NONE and WinXP... In-Reply-To: <454A8829.9000301@copyrightwitness.net> References: <454A8829.9000301@copyrightwitness.net> Message-ID: <454A91C1.4000607@copyrightwitness.net> And the plot thickens... Again using portmon to discover what is happening. Setting: port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN | SerialPort.FLOWCONTROL_XONXOFF_OUT); gives this: 00:35:38 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 00:35:38 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:3 XonLimit:0 XoffLimit:0 00:35:38 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 Which is odder still - the handshake hasnt changed but the replace has!? Any thoughts? WRT to the handshaking Ive now got another device which is happy with h/w flow control and I can read/write from this one OK. Having problems over a USB link though. Regards, Barry Barry Pearce wrote: > Hi folks, > > Ive an oddity under WinXP where I cannot read from a device due to handshaking remaining set at RTS/CTS...for the code > > portId = CommPortIdentifier.getPortIdentifier("COM3"); > port = (SerialPort)portId.open("MyApp", 2000); > port.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > port.close(); > > portmon shows the following in response to the setFlowControlMode method. > > 00:01:54 java.exe IOCTL_SERIAL_SET_BAUD_RATE Serial2 SUCCESS Rate: 9600 > 00:01:54 java.exe IOCTL_SERIAL_CLR_RTS Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_DTR Serial2 SUCCESS > 00:01:54 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 > 00:01:54 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:4 ERR:0 BRK:0 EVT:a XON:0 XOFF:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:0 XonLimit:0 XoffLimit:0 > 00:01:54 java.exe IOCTL_SERIAL_SET_TIMEOUTS Serial2 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:0 > > > As you can see the Shake remains at 1. Doesnt matter how many times you call it - it stays at 1. > > As the device I am talking to refuses to accept RTS/CTS and requires just rx, tx and gnd I therefore receive no data as the lines never go high as the hardware shake is not complied with by the device.... > > Anyone got any ideas how I can get FLOWCONTROL_NONE to *actually* work properly? > > Thanks in advance, > Barry > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From barry.pearce at copyrightwitness.net Sat Nov 4 17:50:21 2006 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Sun, 05 Nov 2006 00:50:21 +0000 Subject: [Rxtx] Data drop-outs and priority in Windows XP Message-ID: <454D354D.80704@copyrightwitness.net> Hi all, > Secondary question: Have anobody else experienced/solved similar problems > without setting the priority to real-time? And if possible, how? Given my postings about this ill say the following. Ive been involved one way or another with serial comms for over 17years in the industry - setting a higher priority for a process is to be honest with you no sort of 'fix/solution' at all...what it is though is evidence of two potential, but related problems. 1. Buffers incorrectly managed within the code. 2. Handshaking incorrect (either in implementation , incorrect choice or none used where some should have been). I suspect from what I am seeing with portmon and my own testing that RXTX's own handshaking configuration of the port is just plain broken. It certainly isnt working properly. This *could* lead to data dropouts and the drivers will not handshake properly. Indeed - in one case I am not able to receive data because it is stuck with RTS/CTS handshaking - and the cable only has 3 wires and should use XON/XOFF....ho hum...I can send out the info - just not recv on the wires. Its been a long time but ive just re-installed MS Vis Studio 6 (said it had been a long time - i didnt expect to ever have to install this again!) - and Im gonna take a look at this - With vis studio installed I should have the approriate headers and be able to compile and debug the handshaking issue... Ill be back soon with my findings... TTFN Barry From vt at freehold.crocodile.org Mon Nov 6 21:59:56 2006 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Mon, 06 Nov 2006 21:59:56 -0700 Subject: [Rxtx] interfaces vs abstract classes In-Reply-To: References: Message-ID: <455012CC.1040504@freehold.crocodile.org> Dr. Douglas Lyon wrote: [four months late to the party, catching up] > public interface SerialPortInterface extends CommPortInterface { > int DATABITS_5 = 5; > int DATABITS_6 = 6; > int DATABITS_7 = 7; > int DATABITS_8 = 8; > int PARITY_NONE = 0; > int PARITY_ODD = 1; > int PARITY_EVEN = 2; > int PARITY_MARK = 3; > int PARITY_SPACE = 4; > int STOPBITS_1 = 1; > int STOPBITS_2 = 2; > int STOPBITS_1_5 = 3; > int FLOWCONTROL_NONE = 0; > int FLOWCONTROL_RTSCTS_IN = 1; > int FLOWCONTROL_RTSCTS_OUT = 2; > int FLOWCONTROL_XONXOFF_IN = 4; > int FLOWCONTROL_XONXOFF_OUT = 8; > Well, I'm thinking that an effort like this can (hopefully) be planned well ahead in advance, and would it make sense to use features that are only available starting with JDK 1.5? By the time this comes out of beta, it'll be used much more widely then it is now... Enumerations would handle the stuff above in a much more elegant way, and will provide type safety: public enum DataBits { five(5), six(6), seven(7), eight(8); public final int bits; public DataBits(int bits) { this.bits = bits; } } and so on and so forth. No more typos and Freudian slips. Hope I'm not too late :) --vt, catching up From ajmas at sympatico.ca Wed Nov 8 08:28:28 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 10:28:28 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Hi, I am trying to build the source from the CVS repository (gnu.io branch) on my MacBook Pro, running MacOS 10.4.8. I am using the XCode project and I am getting the following error: Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/Developer/SDKs/MacOSX10.2.8.sdk' I am not too familiar with XCode, so any help would be appreciated. BTW is it possible to build using the included Makefiles? Everything seems to work, but I don't see any output files. Andre From joachim at buechse.de Wed Nov 8 08:50:52 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 8 Nov 2006 16:50:52 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108152828.IBMV1596.tomts43-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: I set up the projects, such that they compile the ppc binaries against the earlier SDKs. You have 2 options: 1) You need to download the 10.2.8 SDK from Apple and put it in the given place. 2) Change the setting in XCode For 2: - Open the project - Select menu Project/Edit project settings - Select the Build tab - Change the setting SDKROOT_ppc Regards, Joachim --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 16:28, Andre-John Mas wrote: > Hi, > > I am trying to build the source from the CVS repository (gnu.io > branch) on my MacBook Pro, running > MacOS 10.4.8. I am using the XCode project and I am getting the > following error: > > Tool:0: error: There is no SDK at specified SDKROOT_ppc path '/ > Developer/SDKs/MacOSX10.2.8.sdk' > > I am not too familiar with XCode, so any help would be appreciated. > > BTW is it possible to build using the included Makefiles? > Everything seems to work, but I don't see > any output files. > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Wed Nov 8 13:02:54 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:02:54 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Joachim Buechse wrote: > > I set up the projects, such that they compile the ppc binaries > against the earlier SDKs. > > You have 2 options: > 1) You need to download the 10.2.8 SDK from Apple and put it in the > given place. Is that part of the 'December 2002 Mac OS X Developer Tools' download on Apple's ADC member site? Andre From ajmas at sympatico.ca Wed Nov 8 13:51:07 2006 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 8 Nov 2006 15:51:07 -0500 Subject: [Rxtx] Building CVS source on MacOS X intel? Message-ID: <20061108205107.DCLR16051.tomts20-srv.bellnexxia.net@smtp1.sympatico.ca> I changed the ppc dependency used to 10.4u, on my machine, and everything finally compiled. The library seems to be working in my project well enough tp speak to my GPS :) Andre From joachim at buechse.de Thu Nov 9 01:51:10 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 9 Nov 2006 09:51:10 +0100 Subject: [Rxtx] Building CVS source on MacOS X intel? In-Reply-To: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> References: <20061108200254.TEUM1747.tomts25-srv.bellnexxia.net@smtp1.sympatico.ca> Message-ID: It could be around this time, yes... --- Joachim B?chse Softwarel?sungen und Beratung Hadlaubsteig 2 CH-8006 Z?rich On 08.11.2006, at 21:02, Andre-John Mas wrote: > > Joachim Buechse wrote: >> >> I set up the projects, such that they compile the ppc binaries >> against the earlier SDKs. >> >> You have 2 options: >> 1) You need to download the 10.2.8 SDK from Apple and put it in the >> given place. > > Is that part of the 'December 2002 Mac OS X Developer Tools' > download on Apple's > ADC member site? > > Andre > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Sun Nov 12 08:33:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Nov 2006 08:33:01 -0700 (MST) Subject: [Rxtx] Data drop-outs and priority in Windows XP In-Reply-To: <454D354D.80704@copyrightwitness.net> References: <454D354D.80704@copyrightwitness.net> Message-ID: On Sun, 5 Nov 2006, Barry Pearce wrote: > I suspect from what I am seeing with portmon and my own testing that > RXTX's own handshaking configuration of the port is just plain broken. > It certainly isnt working properly. This *could* lead to data dropouts > and the drivers will not handshake properly. Indeed - in one case I am > not able to receive data because it is stuck with RTS/CTS handshaking - > and the cable only has 3 wires and should use XON/XOFF....ho hum...I can > send out the info - just not recv on the wires. > > Its been a long time but ive just re-installed MS Vis Studio 6 (said it > had been a long time - i didnt expect to ever have to install this > again!) - and Im gonna take a look at this - With vis studio installed I > should have the approriate headers and be able to compile and debug the > handshaking issue... > Hi Barry, Sorry for the slow response. I've been in the wilderness for 9 days without Internet access. We have a cross-compiler that you can use out of the box on qbang. If you like, I can give you access to the 'bob account' which is for this purpose. You just change the files, upload them and type make. From lists at java-system.com Sun Nov 12 13:53:37 2006 From: lists at java-system.com (marco tozzini) Date: Sun, 12 Nov 2006 21:53:37 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt Message-ID: <455789D1.5010709@java-system.com> Hi, I'm trying to compile RxTx for OpenWrt linux distro for small MIPS based devices right now OpenWRT project has a OpenWRT sdk that create a toolchain to build package for that environment At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have a good HowTo that explain how to port new packages to openwrt env. I'm NOT a programmer expert, so I was not able to create a decent Makefile to compile rxtx source code for OpenWRT I wonder if somebody can address me to a solution Thanks for your help Ciao Marco From lists at java-system.com Tue Nov 14 14:08:27 2006 From: lists at java-system.com (marco tozzini) Date: Tue, 14 Nov 2006 22:08:27 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: <455A304B.6060205@java-system.com> Following the infos at the OpenWrt website I had to change the rxtx archive file from zip to tar.gz to anable OpenWRT script to expand the archive (that was the simplest way I KNOW 'unfortunately' .... ) OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from SableVM home page and change the Makefile inside rxtx to point to SableVM include directory (Makefile from rxtx require jni_md.h is I well remeber) Again I get a 'no architecture specified' error and no good result Any help? Ciao Marco From lyon at docjava.com Wed Nov 15 05:03:10 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Nov 2006 08:03:10 -0400 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455A304B.6060205@java-system.com> References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: Hi All, Marco, I tried to follow your footsteps by installing Sable, but make emitted: ***ERROR: libltdl is missing Did you have this problem? If so, how do I address it? A web search indicates the problem is common. Thanks! - Doug >Following the infos at the OpenWrt website I had to change the rxtx >archive file >from zip to tar.gz to anable OpenWRT script to expand the archive >(that was the simplest way I KNOW 'unfortunately' .... ) > >OpenWRT uses SableVM as Java VM so I need to download SableVM sdk from >SableVM home page and change the Makefile inside rxtx to point to SableVM >include directory (Makefile from rxtx require jni_md.h is I well remeber) > >Again I get a 'no architecture specified' error and no good result > >Any help? > >Ciao >Marco > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Nov 15 09:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 15 Nov 2006 09:12:47 -0700 (MST) Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: <455789D1.5010709@java-system.com> References: <455789D1.5010709@java-system.com> Message-ID: On Sun, 12 Nov 2006, marco tozzini wrote: > Hi, > > I'm trying to compile RxTx for OpenWrt linux distro for small MIPS > based devices > > right now OpenWRT project has a OpenWRT sdk that create a toolchain > to build package for that environment > At this page (http://wiki.openwrt.org/BuildingPackagesHowTo) they have > a good HowTo that explain how to port new packages to openwrt env. > > I'm NOT a programmer expert, so I was not able to create a decent Makefile > to compile rxtx source code for OpenWRT > > I wonder if somebody can address me to a solution > > Thanks for your help > Hi Marco I did try this some. Their toolchains do not match my libc version which is going to cause many problems. This is a simple cross compile complicated by a packaging scheme wrt is using. We have done cross-compiles for such targets. Perhaps they have uclib vs gcc as the final target? We did glibc. ftp://ftp.qbang.org/pub/rxtx/ToyBox/2.1-7-build1/Linux/glibc-2.3.5 There are mips targets there but probably the wrong libc end target. My question would be what your final goal is. Are you interested in preparing a wrt target package or just a mips uclib library for use? -- Trent Jarvi tjarvi at qbang.org From lists at java-system.com Thu Nov 16 02:23:42 2006 From: lists at java-system.com (Marco Tozzini) Date: Thu, 16 Nov 2006 10:23:42 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> Message-ID: <20061116092342.17970.qmail@webmaild.fe1.aruba.it> Trent, I have my own OpenWRT box (ASUS Router) with serial port added (I added 2 serial port to it - it's almost trivial) I installed SableVM that is the JVM already ported to OpenWRT platform I'm using RxTx to drive Maxim 1Wire bus devices through JavaOneWireAPI on a standard PC, and I wonder if I can port the same systems to my new box I'm not an expert, but looking at OpenWRT repository(https://dev.openwrt.org/browser/branches/whiterussian/openwrt/pac kage ......who knows if this is the right one :) ) I saw uClibc and uClibc++ are used on OpwnWRT systems I don't know how to manage glibc compilation, crosscompilation and installation of compilation results, so for me the simplest way is to follow the ipkg method Hope you can help me further Ciao Marco ----- Original Message ----- Da : Trent Jarvi A : RXTX Developers and Users Oggetto : Re: [Rxtx] How to compile RxTx for OpenWrt Data : Wed, 15 Nov 2006 09:12:47 -0700 (MST) > > My question would be what your final goal is. Are you > interested in preparing a wrt target package or just a > mips uclib library for use? > > -- > Trent Jarvi From lists at java-system.com Fri Nov 17 01:54:24 2006 From: lists at java-system.com (Marco Tozzini) Date: Fri, 17 Nov 2006 09:54:24 +0100 Subject: [Rxtx] How to compile RxTx for OpenWrt In-Reply-To: References: <455789D1.5010709@java-system.com> <455A304B.6060205@java-system.com> Message-ID: <20061117085424.31429.qmail@webmaild.fe1.aruba.it> Hi Douglas Have you tried to install Sable on a OpenWRT box or on your Desktop PC? On a OpenWRT box you can find a ipkg package with sableVM It's a backport of unstable version 'kamikaze' - and you need to download package from backport directory repository Please note that there are several sable packages, try to download all you need For desktop PC I'm using Debian Unstable and I have prepackaged binaries available from officila debian archive In each case I have no error during install process Is this what you need to know? Ciao Marco Dr. Douglas Lyon writes: > Hi All, > Marco, I tried to follow your footsteps by installing Sable, but > make emitted: > ***ERROR: libltdl is missing > Did you have this problem? > If so, how do I address it? A web search indicates the problem > is common. > Thanks! > - Doug > From richardc at eecosystems.com Fri Nov 17 11:33:36 2006 From: richardc at eecosystems.com (Richard Clem) Date: Fri, 17 Nov 2006 10:33:36 -0800 Subject: [Rxtx] RXTX Install Problem on Ubuntu & Blackdown JRE Message-ID: <455E0080.3010202@eecosystems.com> I am trying to get an application that is working on MacOSX in Eclipse working on Ubuntu in Eclipse. I downloaded and installed the jre from Blackdown and the current RXTX releated files and my project builds without errors, but when I run my test I receive the following error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Exception during event dispatch: java.lang.NullPointerException at java.util.Arrays$ArrayList.(libgcj.so.7) at java.util.Arrays.asList(libgcj.so.7) at javax.swing.DefaultComboBoxModel.(libgcj.so.7) at examples.UPBTester.(UPBTest